package com.example.demo.controller;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.ExceptionHandler;

@Component
@Aspect
public class HaAOP {

    @Around("@annotation(exceptionHandler)")
    public Object around(ProceedingJoinPoint pjp, ExceptionHandler exceptionHandler) throws Throwable {
        System.out.println("这里我被拦截了");
        return pjp.proceed();
    }
}
